<template>
	<poupPick :title="checkBoxVal.join()">
		<template v-slot:content>
			<scrollYCheckbox :list="field.option" v-model="checkBoxVal" />
		</template>
	</poupPick>
</template>

<script>
	import poupPick from "@/components/form/poupPick/poupPick.vue";
	import scrollYCheckbox from '@/components/form/scrollYCheckbox/scrollYCheckbox.vue';

	export default {
		components: {
			poupPick,
			scrollYCheckbox,
		},
		props: {
			value: {
				type: Array,
				default: () => ([]),
			},
			field: {
				type: Object,
				default: () => ({}),
			},
			model: {
				type: Object,
				default: () => ({}),
			},
		},
		data() {
			return {
				checkBoxVal: ''
			}
		},
		watch: {
			checkBoxVal(newValue) {
				this.$emit('update:value', newValue);
			},
		},
	};
</script>